<template>
  <div class="detail-enterprise">
    <header class="add-header">
      <el-page-header content="查看企业" @back="$router.back()" />
    </header>

    <main class="add-main">
      <div class="form-container">
        <div class="title">企业信息</div>
        <div class="form">
          <el-form ref="form" :model="from">
            <el-form-item label="企业名称:">
              <span>{{ from.name }}</span>
            </el-form-item>
            <el-form-item label="法人:">
              <span>{{ from.legalPerson }}</span>
            </el-form-item>
            <el-form-item label="注册地址:">
              <span>{{ from.registeredAddress }}</span>
            </el-form-item>
            <el-form-item label="所在行业:">
              <span>{{ from.industryName }}</span>
            </el-form-item>
            <el-form-item label="营业执照:">
              <img :src="from.businessLicenseUrl" alt="" width="300" height="200">
              <!-- <span>{{ from.businessLicenseUrl }}</span> -->
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div class="form-container">
        <div class="title">联系人信息</div>
        <div class="form">
          <el-form ref="from" :model="from">
            <el-form-item label="企业联系人:">
              <span>{{ from.contact }}</span>
            </el-form-item>
            <el-form-item label="联系电话:">
              <span>{{ from.contactNumber }}</span>
            </el-form-item>
          </el-form>
        </div>
      </div>

    </main>

  </div>

</template>

<script>
import { getEnterpriseDetailAPI } from '@/api/enterprise'
export default {
  data() {
    return {
      from: {
        id: '',
        name: '',
        legalPerson: '',
        registeredAddress: '',
        industryCode: '',
        industryName: '',
        businessLicenseUrl: '',
        businessLicenseName: '',
        businessLicenseId: '',
        contact: '',
        contactNumber: ''
      }

    }
  },
  created() {
    this.getEnterpriseDetailAPI1()
  },
  methods: {
    async getEnterpriseDetailAPI1() {
      const id = this.$route.query.id
      const res = await getEnterpriseDetailAPI(id)
      // console.log(res)
      this.from = res.data
    }
  }
}
</script>

<style scoped lang="scss">
.add-main     .form-container {
      background-color: #fff;
      margin-bottom: 20px;
      border-radius: 4px;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

      .title {
        height: 60px;
        line-height: 60px;
        padding-left: 20px;
        font-size: 16px;
        font-weight: bold;
        border-bottom: 1px solid #ebeef5;
      }

      .form {
        padding: 20px;

        .el-form {
          display: flex;
          flex-wrap: wrap;

          .el-form-item {
            width: 50%;
            margin-bottom: 20px;

            .el-input {
              width: 80%;
            }
          }
        }
      }
    }
.detail-enterprise {
  background-color: #f4f6f8;
  height: 100vh;

  .add-header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 64px;
    background-color: #fff;

    .left {
      span {
        margin-right: 4px;
      }
      .arrow{
        cursor: pointer;
      }
    }

    .right {
      text-align: right;
    }
  }

  .add-main {
    background: #f4f6f8;
    padding: 20px 130px;

    .form-container {
      background-color: #fff;
      margin-bottom: 20px;
      .title {
        height: 60px;
        line-height: 60px;
        padding-left: 20px;
      }
    }
    .table-container{
      padding:20px;
    }
    .preview{
      img{
        width: 100px;
      }
    }
  }
}
</style>
